/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package isvp.tree.customizations;

import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author patsrik
 */
public class ISVPTreeNode extends DefaultMutableTreeNode {
    private Object dataObject;
    private String name;
    private boolean componentNode;
    private String parentNodeName;
    
    /**
     * Constructor for creating a new tree node
     * @param childObject : The ISVPJPanel object that has to be shown in the UI when the node is clicked
     * @param dataObject  : Data to be filled in the UI
     * @param componentName : Name of the node which will be displayed in the UI
     */
    public ISVPTreeNode(Object childObject, String nodeName, boolean isComponentNode, Object dataObject) {
        this(childObject, nodeName, isComponentNode);
        this.dataObject = dataObject;
    }
    
    public ISVPTreeNode(Object childObject, String nodeName, boolean isComponentNode) {
        super(childObject);
        this.name = nodeName;
        this.componentNode = isComponentNode;
    }

    public String getName() {
        return name;
    }

    public void setName(String componentName) {
        this.name = componentName;
    }

    public Object getDataObject() {
        return dataObject;
    }

    public void setDataObject(Object dataObject) {
        this.dataObject = dataObject;
    }

    public boolean isComponentNode() {
        return componentNode;
    }

    public void setComponentNode(boolean componentNode) {
        this.componentNode = componentNode;
    }

    public String getParentNodeName() {
        return parentNodeName;
    }

    public void setParentNodeName(String parentNodeName) {
        this.parentNodeName = parentNodeName;
    }
    
    @Override
    public String toString() {
        return name;
    }
}
